import React, { useEffect, useState } from 'react'
import "./Detail.scss"
import { useParams } from 'react-router-dom'
import { getDetai } from '../../request'
import { NavBar } from 'antd-mobile'
function Detail() {
    const { id } = useParams()
    const [mydetail, setMydetail] = useState([])
    useEffect(() => {
        getDetai(id).then(res => {
            console.log(333, res)
            setMydetail(res.data.data)
        })
    }, [])
    return (
        <div className='detail-box'>
            <div>
                <NavBar>北京到上海</NavBar>
            </div>
            <div>
                <h3>起{mydetail.startTime} <span>{mydetail.startAirport}</span></h3>
                <h3>落{mydetail.endTime} <span>{mydetail.endAirport}</span></h3>
                <p>价格{mydetail.price}</p>
            </div>

        </div>
    )
}

export default Detail
